package com.superatom.springframework.beans.factory.parsing;

import com.superatom.springframework.core.io.Resource;
import com.superatom.springframework.lang.Nullable;

/**
 * @author Kwokchiu Wong
 * @Title:
 * @Package
 * @Description:
 * @date 2020/10/19 10:27 上午
 */
@FunctionalInterface
public interface SourceExtractor {

    /**
     * Extract the source metadata from the candidate object supplied
     * by the configuration parser.
     * @param sourceCandidate the original source metadata (never {@code null})
     * @param definingResource the resource that defines the given source object
     * (may be {@code null})
     * @return the source metadata object to store (may be {@code null})
     */
    @Nullable
    Object extractSource(Object sourceCandidate, @Nullable Resource definingResource);

}
